var Define = require("../../../../lib/Define.js")

var _wareId = 0;
Page({
  data:{
    ware:{},
    serviceName:""
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    _wareId = options.wareId;

    this.setData({
      serviceName:Define.value.serviceName
    })

    this.requestWareDetail()
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  },
  requestWareDetail:function(){
    var self = this

    wx.request({
      url: Define.value.baseUrl+'/app/ware/detail?wareId='+_wareId,
      data: {},
      method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      // header: {}, // 设置请求的 header
      success: function(res){
        var data = res.data;
        if(data.code == 200){
          self.setData({
            ware:data.data
          })
        }
      },
      fail: function() {
        // fail
      },
      complete: function() {
        // complete
      }
    })

  },
  callBtnClick:function(){
    Define.callServicePhone()
  }
})